<template>
  <div>
    <div id="line" style="width: 500px; height: 400px"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      xData: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      yData: [150, 230, 224, 218, 135, 147, 260],
    };
  },
  mounted() {
    this.lineChart();
  },
  methods: {
    lineChart() {
      var myChart = this.$echarts.init(document.getElementById("line"));
      myChart.setOption({
        xAxis: {
          type: "category",
          data: this.xData,
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            data: this.yData,
            type: "line",
          },
        ],
      });
    },
  },
};
</script>

<style lang="scss" scoped>
</style>